----------------------------------------------------------------------------------
      name:  <unnamed>
       log:  G:\My Drive\Research\CTC expansion\submission\ntj\stata replication f
> iles/output/figureA5.log
  log type:  text
 opened on:   3 Dec 2023, 18:18:56

. 
. version 16      

. 
. use "$data/ctctaxsim_mar1kid1.dta", clear

. append using "$data/ctctaxsim_mar1kid2.dta"
(label YEAR already defined)

. append using "$data/ctctaxsim_mar1kid3.dta"
(label YEAR already defined)

. tab depx

       depx |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     20,000       33.33       33.33
          2 |     20,000       33.33       66.67
          3 |     20,000       33.33      100.00
------------+-----------------------------------
      Total |     60,000      100.00

. 
. sum fiitax earnings fedtaxlessctc v25 totctc

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
      fiitax |     60,000   -902.5994    4682.152    -9708.5     9338.5
    earnings |     60,000      49.995    28.86775          0      99.99
fedtaxless~c |     60,000    1616.028    4785.037      -6431    10338.5
         v25 |     60,000    1.601453    2.071323          0      6.431
      totctc |     60,000    2.518628    1.614441          0          6

. replace earnings=earnings*1000
(59,994 real changes made)

. replace ctc=ctc*1000
(60,000 real changes made)

. replace v25=v25*1000
(30,208 real changes made)

. replace totctc=totctc*1000
(58,344 real changes made)

. sum fiitax earnings fedtaxlessctc v25 totctc

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
      fiitax |     60,000   -902.5994    4682.152    -9708.5     9338.5
    earnings |     60,000       49995    28867.75          0      99990
fedtaxless~c |     60,000    1616.028    4785.037      -6431    10338.5
         v25 |     60,000    1601.453    2071.323          0       6431
      totctc |     60,000    2518.628    1614.441          0       6000

. 
. gen avgtaxrate=fiitax/earnings
(6 missing values generated)

. gen avgtaxrate2021=fedtaxlessctc/earnings       /* Don't include new CTC */
(6 missing values generated)

. 
. gen avgtaxeitc=-v25/earnings
(6 missing values generated)

. gen avgtaxctc=-totctc/earnings
(6 missing values generated)

. gen avgtaxctc2021=0

. 
. gen avgtaxeitcctc=avgtaxeitc+avgtaxctc
(6 missing values generated)

. 
. gen avginctax=avgtaxrate- avgtaxeitcctc
(6 missing values generated)

. 
. tab year avginctax if earnings==40000 & depx==1

    census |       avginctax
      year |   .037875        .04 |     Total
-----------+----------------------+----------
      2017 |         1          0 |         1 
      2018 |         0          1 |         1 
-----------+----------------------+----------
     Total |         1          1 |         2 

. replace avginctax=avginctax*.04/.037875 if year==2017
(23,260 real changes made)

. tab year avginctax if earnings==40000 & depx==1

    census | avginctax
      year |       .04 |     Total
-----------+-----------+----------
      2017 |         1 |         1 
      2018 |         1 |         1 
-----------+-----------+----------
     Total |         2 |         2 

. 
. foreach var in avgtaxeitc avgtaxctc avgtaxctc2021 avginctax{
  2.         replace `var'=-`var'
  3. }
(30,208 real changes made)
(58,344 real changes made)
(0 real changes made)
(47,588 real changes made)

. 
. foreach var in avgtaxeitc avgtaxctc avgtaxctc2021 avginctax{
  2.         replace `var'=`var'+1
  3. }
(59,994 real changes made)
(59,994 real changes made)
(60,000 real changes made)
(59,994 real changes made)

. 
. replace avgtaxrate=-avgtaxrate+1
(59,994 real changes made)

. replace avgtaxrate2021=-avgtaxrate2021+1
(59,994 real changes made)

. 
. bysort earnings depx: egen minavgtax=min(avgtaxrate)
(6 missing values generated)

. gen difavgtax2=avgtaxrate2021-minavgtax
(6 missing values generated)

. sum difavgtax2

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  difavgtax2 |     59,994    -.047224    .0350058  -.1304348   .0060076

. 
. bysort earnings depx: egen maxavgtax=max(avgtaxrate)
(6 missing values generated)

. gen difavgtax=avgtaxrate2021-maxavgtax
(6 missing values generated)

. sum difavgtax

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
   difavgtax |     59,994   -.0755276    .0367987  -.1590164          0

. 
. gen difavgtax3=minavgtax-maxavgtax
(6 missing values generated)

. 
. sort earnings depx year 

. order year earnings depx *avgtax* dif*

. drop if year==2017
(30,000 observations deleted)

. replace difavgtax3=-difavgtax3
(29,247 real changes made)

. 
. twoway line difavgtax2 earnings if year==2018 & depx==1, lp(-) pstyle(p1) || lin
> e difavgtax2 earnings if year==2018 & depx==2, lp(_) pstyle(p2) || line difavgta
> x2 earnings if year==2018 & depx==3, pstyle(p1) graphregion(color(white)) bgcolo
> r(white) leg(order(1 "1 Kid" 2 "2 Kids" 3 "3 Kids") c(1) pos(5) ring(0)) ytitle(
> "Change in Return to Work") xtitle("Earnings" "{bf:Panel A: 2021 vs 2020}") 

. graph save "$output/avgtax2.gph", replace
(file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication
    files/output/avgtax2.gph not found)
file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication files/out
> put/avgtax2.gph saved

. 
. 
. twoway line difavgtax earnings if year==2018 & depx==1, lp(-) pstyle(p1) || line
>  difavgtax earnings if year==2018 & depx==2, lp(_) pstyle(p2) || line difavgtax 
> earnings if year==2018 & depx==3, pstyle(p1) graphregion(color(white)) bgcolor(w
> hite) leg(order(1 "1 Kid" 2 "2 Kids" 3 "3 Kids") c(1) pos(5) ring(0)) ytitle("Ch
> ange in Return to Work") xtitle("Earnings" "{bf:Panel B: 2021 vs 2017}")  

. graph save "$output/avgtax.gph", replace
(file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication
    files/output/avgtax.gph not found)
file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication files/out
> put/avgtax.gph saved

. 
. 
. twoway line difavgtax3 earnings if year==2018 & depx==1, lp(-) pstyle(p1) || lin
> e difavgtax3 earnings if year==2018 & depx==2, lp(_) pstyle(p2) || line difavgta
> x3 earnings if year==2018 & depx==3, pstyle(p1) graphregion(color(white)) bgcolo
> r(white) leg(order(1 "1 Kid" 2 "2 Kids" 3 "3 Kids") c(1) pos(2) ring(0)) ytitle(
> "Change in Return to Work") xtitle("Earnings" "{bf:Panel C: 2020 vs 2017}")  

. graph save "$output/avgtax3.gph", replace
(file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication
    files/output/avgtax3.gph not found)
file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication files/out
> put/avgtax3.gph saved

. 
. 
. graph combine "$output/avgtax2.gph" "$output/avgtax.gph" "$output/avgtax3.gph",g
> raphregion(color(white)) 

. graph export "$output/figureA5.png", replace
file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication
    files/output/figureA5.png saved as PNG format

. 
. erase "$output/avgtax2.gph" 

. erase "$output/avgtax.gph" 

. erase"$output/avgtax3.gph"

. 
. log close
      name:  <unnamed>
       log:  G:\My Drive\Research\CTC expansion\submission\ntj\stata replication f
> iles/output/figureA5.log
  log type:  text
 closed on:   3 Dec 2023, 18:19:00
----------------------------------------------------------------------------------
